﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Menu
    {

        public void menu()
        {
            int B = 0;
            Calculator Cal = new Calculator();
            
            do
            {
                Console.ForegroundColor = ConsoleColor.Blue;
                Console.BackgroundColor = ConsoleColor.White;
                
                Console.WriteLine("1.Cong hai so");
                Console.WriteLine("2.Tru hai so");
                Console.WriteLine("3.nhan hai so");
                Console.WriteLine("4.chia hai so");
                Console.WriteLine("0.thoat chuong trinh");
                Console.Write("nhap lua chon cua:");
                int A = Convert.ToInt16(Console.ReadLine());
                
                float KQ;
                switch (A)
                {
                    case 1:
                        Console.WriteLine("chon chuc cong");
                        Cal.NhapDuLieu();
                         KQ = Cal.CongHaiSo();
                         Console.WriteLine("ket qua : {0}", KQ);
                         Console.ReadLine();
                        break;
                    case 2:
                        Console.WriteLine("chon chuc tru");
                        Cal.NhapDuLieu();
                        KQ = Cal.TruHaiSo();
                        Console.WriteLine("ket qua : {0}", KQ);
                        Console.ReadLine();
                        break;
                    case 3:
                        Console.WriteLine("chon chuc nhan");
                        Cal.NhapDuLieu();
                        KQ = Cal.NhanHaiSo();
                        Console.WriteLine("ket qua : {0}", KQ);
                        Console.ReadLine();
                        break;
                    case 4:
                        Console.WriteLine("chon chuc chia");
                        Cal.NhapDuLieu();
                        KQ = Cal.ChiaHaiSo();
                        Console.WriteLine("ket qua : {0}", KQ);
                        Console.ReadLine();
                        break;
                    case 0:
                        Console.WriteLine("thoat");
                        Environment.Exit(0);
                        break;
                    default:
                        Console.WriteLine("ban chon chuc nang nao");
                        break;

                }
                Console.Clear();
            }
            while (B == 0);
        }
    }
}
